﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mvc.XForms {
	public class CssClass {
		private StringBuilder cssClass;

		public CssClass() {
			this.cssClass = new StringBuilder();
		}

		public CssClass(string cssClass) {
			this.cssClass = new StringBuilder(cssClass);
		}

		public void Add(string cssClass) {
			if (HasClass)
				this.cssClass.Append(" ");
			this.cssClass.Append(cssClass);
		}

		public bool HasClass {
			get { return cssClass.Length > 0; }
		}

		public override string ToString() {
			return cssClass.ToString();
		}
	}
}
